#ifndef SYSCALLS_BUZZLOCK_H
#define SYSCALLS_BUZZLOCK_H
#include <asm/semaphore.h>
#include <linux/completion.h>

typedef unsigned int useconds_t;
typedef struct bzz {
    struct semaphore lock;
    struct semaphore queue_lock;
    struct semaphore black_lock;
    struct semaphore old_gold_lock;
    struct completion new_gold_lock;
    int timeout;
    int in_use;
    int cur_threads;
    int num_threads;
    int black, old_gold, new_gold;
    int bsig, ogsig, ngsig;
    int *colors;
    int *threads;
    
} bzz;

typedef bzz * bzz_t;

struct my_ptrs{
	long (*f1)(bzz_t, int, useconds_t);
	long (*f2)(int, bzz_t);
	long (*f3)(bzz_t);
	long (*f4)(bzz_t);
	long (*f5)(bzz_t) ;
};

extern struct my_ptrs myptrs;
asmlinkage long sys_init_bzz(bzz_t *lock, int nt, useconds_t timeout);
asmlinkage long sys_bzz_color(int color, bzz_t lock);
asmlinkage long sys_bzz_lock(bzz_t lock);
asmlinkage long sys_bzz_release(bzz_t lock);
asmlinkage long sys_bzz_kill(bzz_t lock);

#endif
